function getWindowWidth() {if (window.innerWidth) {return window.innerWidth;}else if (document.documentElement.clientWidth) {return document.documentElement.clientWidth;}else return 0;}function getWindowHeight() {if (window.innerHeight) {return window.innerHeight;}else if (document.documentElement.clientHeight) {return document.documentElement.clientHeight;}else return 0;}function getPageLeftOffSet() { if (window.pageXOffset) {return window.pageXOffset; } else if (document.documentElement && document.documentElement.scrollLeft) {return document.documentElement.scrollLeft; }else return 0;}function getPageTopOffSet() { if (window.pageYOffset) {return window.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop) {return document.documentElement.scrollTop; }else return 0;}function heightOf(object) { if (object.offsetHeight) return object.offsetHeight; else if (object.length) return document.getElementById(object).offsetHeight; return 0;}function widthOf(object) { if (object.offsetWidth) return object.offsetWidth; else if (object.length) return document.getElementById(object).offsetWidth;return 0;}function getCSSRules() { var css_rules = (document.styleSheets[0].cssRules) ? document.styleSheets[0].cssRules : document.styleSheets[0].rules; return css_rules;}function getCookieValue(key) {return document.cookie.getValueOf(key, ";");}function setCookieValue(key, value, expiretime) {var now = new Date();var expire = new Date(now.getTime() + expiretime);document.cookie = key + "=" + value + "; expires=" + expire.toGMTString() + ";";}function addStyleClass(object, classname) { object.className += " " + classname;}function removeStyleClass(object, classname) { var class_name = object.className; class_name = class_name.replace(new RegExp("\\b" + classname + "\\b"), ""); class_name = class_name.replace(/ +/g, " "); object.className = class_name;}function hasStyleClass(object, classname) { var searchpattern = "\\b" + classname + "\\b"; return object.className.search(new RegExp(searchpattern)) != -1;}String.prototype.trim = function () { return this.replace (/^\s+/, '').replace (/\s+$/, '');};String.prototype.getValueOf = function (key, separator) { var key_value_array = this.split(separator); var searchstring = "^"+key+"="; var value = "n.a."; var index = -1; var key_value; for (var i = 0; i < key_value_array.length; i++) {key_value = key_value_array[i].trim();index = key_value.search(new RegExp(searchstring));if (index != -1) { value = key_value.slice(key.length + 1);} } return value;};function transformDropDownMenus(select_stylewidth) { var select_array = document.getElementsByTagName("select"); for (var i = 0; i < select_array.length; i++) {if (select_array[i].style.display == "none") { select_array[i].style.display = "inline"; select_array[i].previousSibling.style.display = "none";}else { select_array[i].style.display = "none"; if (!select_array[i].previousSibling || select_array[i].previousSibling.className != "selectdummy") {var input_element = document.createElement("input");input_element.type = "text";input_element.className = "selectdummy";select_array[i].parentNode.insertBefore(input_element, select_array[i]); } select_array[i].previousSibling.value = select_array[i].options[select_array[i].selectedIndex].innerHTML; if (select_stylewidth) select_array[i].previousSibling.style.width = select_stylewidth; else select_array[i].previousSibling.style.width = select_array[i].style.width; select_array[i].previousSibling.style.display = "inline";} }}function getValidX(mouse_x, object_width, distance_mouse_object) { var offset = getPageLeftOffSet();var x_full = (mouse_x + object_width + distance_mouse_object);if ((x_full + 10) > getWindowWidth()) {x_full = mouse_x + offset - object_width - distance_mouse_object;if (x_full < offset) return offset;else return x_full; }else return (mouse_x + offset + distance_mouse_object);}function getValidY(mouse_y, object_height, distance_mouse_object) { var offset = getPageTopOffSet();var y_full = (mouse_y + object_height + distance_mouse_object);if ((y_full + 10) > getWindowHeight()) {y_full = mouse_y + offset - object_height - distance_mouse_object;if (y_full < offset) return offset;else return y_full; }else return (mouse_y + offset + distance_mouse_object);}
